/*
 */

package com.core.basic.secure.domain;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import common.base.*;
import common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.util.page.*;
import cn.org.rapid_framework.page.*;


import com.core.basic.secure.domain.*;
import com.core.basic.secure.dao.*;
import com.core.basic.secure.service.*;
import com.core.basic.secure.query.*;

/**
 */


public class Users implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Users";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_ACCOUNT = "account";
	public static final String ALIAS_PASSWORD = "password";
	public static final String ALIAS_CLASSNO = "classno";
	public static final String ALIAS_PHONE = "phone";
	public static final String ALIAS_DEP = "dep";
	public static final String ALIAS_ENABLE = "enable";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Long id;
	@NotBlank @Length(max=255)
	private java.lang.String account;
	@NotBlank @Length(max=255)
	private java.lang.String password;
	@Length(max=45)
	private java.lang.String classno;
	@Length(max=45)
	private java.lang.String phone;
	@Length(max=45)
	private java.lang.String dep;
	
	private java.lang.Integer enable;
	//columns END

	public Users(){
	}

	public Users(
		java.lang.Long id
	){
		this.id = id;
	}

	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	public void setAccount(java.lang.String value) {
		this.account = value;
	}
	
	public java.lang.String getAccount() {
		return this.account;
	}
	public void setPassword(java.lang.String value) {
		this.password = value;
	}
	
	public java.lang.String getPassword() {
		return this.password;
	}
	public void setClassno(java.lang.String value) {
		this.classno = value;
	}
	
	public java.lang.String getClassno() {
		return this.classno;
	}
	public void setPhone(java.lang.String value) {
		this.phone = value;
	}
	
	public java.lang.String getPhone() {
		return this.phone;
	}
	public void setDep(java.lang.String value) {
		this.dep = value;
	}
	
	public java.lang.String getDep() {
		return this.dep;
	}
	public void setEnable(java.lang.Integer value) {
		this.enable = value;
	}
	
	public java.lang.Integer getEnable() {
		return this.enable;
	}
	
	private Set usersHasRoless = new HashSet(0);
	public void setUsersHasRoless(Set usersHasRoless){
		this.usersHasRoless = usersHasRoless;
	}
	
	public Set getUsersHasRoless() {
		return usersHasRoless;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Account",getAccount())
			.append("Password",getPassword())
			.append("Classno",getClassno())
			.append("Phone",getPhone())
			.append("Dep",getDep())
			.append("Enable",getEnable())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Users == false) return false;
		if(this == obj) return true;
		Users other = (Users)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

